'    Copyright 2008 Jan Molnar <jan.molnar@abds.de>
'
'    This file is part of JCQ.

'    JCQ is free software: you can redistribute it and/or modify
'    it under the terms of the GNU General Public License as published by
'    the Free Software Foundation, either version 2 of the License, or
'    (at your option) any later version.

'    JCQ is distributed in the hope that it will be useful,
'    but WITHOUT ANY WARRANTY; without even the implied warranty of
'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'    GNU General Public License for more details.

'    You should have received a copy of the GNU General Public License
'    along with JCQ. If not, see <http://www.gnu.org/licenses/>.

Imports System.Collections.ObjectModel

Public Interface IStorageService
    Inherits IContextService

    Function GetContactByIdentifier(ByVal identifier As String) As IContact
    Function GetGroupByIdentifier(ByVal identifier As String) As IGroup

    Function IsContactStored(ByVal contact As IContact) As Boolean

    ReadOnly Property IsContactListAvailable() As Boolean
    ReadOnly Property IsFreshContactList() As Boolean

    ReadOnly Property Info() As IContactListInfo

    ReadOnly Property Groups() As Core.Interfaces.INotifyingCollection(Of IGroup)
    ReadOnly Property Contacts() As Core.Interfaces.INotifyingCollection(Of IContact)

    ReadOnly Property MasterGroup() As IGroup

    Event ContactListActivated As EventHandler

    Event ContactStatusChanged As EventHandler(Of StatusChangedEventArgs)

    Sub AddContact(ByVal contact As IContact, ByVal group As IGroup)
    Sub AttachContact(ByVal contact As IContact, ByVal group As IGroup, ByVal stored As Boolean)
    Sub RemoveContact(ByVal contact As IContact, ByVal group As IGroup)
    Sub UpdateContact(ByVal contact As IContact)

    Sub AddGroup(ByVal group As IGroup)
    Sub RemoveGroup(ByVal group As IGroup)
    Sub UpdateGroup(ByVal group As IGroup)

    Sub RegisterLocalContactList(ByVal itemCount As Integer, ByVal dateChanged As Date)
End Interface

Public Interface IContactListInfo
    ReadOnly Property ItemCount() As Integer
    ReadOnly Property DateChanged() As Date
End Interface